<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>用户信息管理</title>
    <link rel="stylesheet" type="text/css" th:href="@{/styles.css}">
</head>
<body>
<div class="container">
    <h2>用户信息管理</h2>
    <div class="table-container">
        <table>
            <thead>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="user : ${users}">
                <td th:text="${user.id}"></td>
                <td th:text="${user.username}"></td>
                <td>
                    <a th:href="@{/user/edit/{id}(id=${user.id})}" class="btn btn-edit">编辑</a>
                    <a th:href="@{/user/delete/{id}(id=${user.id})}" class="btn btn-delete" onclick="return confirm('确定要删除此用户吗？')">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <a href="/login" class="back-link">返回登录页</a>
</div>
</body>
</html>